#!/bin/bash
#$1 ftp地址 $2 ftp 用户名密码（http时忽略） $3系统密码
echo "begin--------------------upgrade------------------"
echo "begin down loading---------" > ../display.txt
binpath=/home/linaro/work/edge/bin
rm -f /home/linaro/work/edge/upload/newversion.tar.gz
curl -o /home/linaro/work/edge/upload/newversion.tar.gz $1 $2 >> ../display.txt
echo "down loading finished---------" >> ../display.txt
ls /home/linaro/work/edge/upload/newversion.tar.gz -l --block-size=k  >> ../display.txt
tar tf /home/linaro/work/edge/upload/newversion.tar.gz >> ../display.txt
cd $binpath
echo "begin call upgrade.sh--------------" >> ../display.txt
./upgrade.sh /home/linaro/work/edge/upload/newversion.tar.gz $3